c = 69.44
h = 71.25
l = 68.60
RSV = (c-l)/(h-l)

pre_k = 36.06
pre_d = 38.22

K = pre_k*2/3 - RSV*1/3
D = pre_d*2/3 - K*1/3
J = 2/3*K - 1/3*D

print(J)

# 倒推公式
# 根据 J 值推算 当日最低价

J = 2/3*pre_k*2/3 - 2/3*(c-l)/(h-l)*1/3 - 1/3*pre_d*2/3 - (pre_k*2/3 - (c-l)/(h-l)*1/3)*1/3
# 化简
J = 4/9*(pre_k)-2/9*(c-l)/(h-l)-2/9*pre_d-2/9*pre_k - (c-l)/(h-l)*1/9
J = 2/9*(pre_k)-1/9*(c-l)/(h-l)-2/9*pre_d

def get_lowest_price(pre_k, pre_d, J):
    # 猜测 J值 为 < -1
    return (J+2/9*pre_d-2/9*pre_k)*(-9)


print(get_lowest_price(pre_k, pre_d, -2.5))